
import java.io.*;
import java.util.*;

/**
 * 
 */
public static void main(String[] args) {
    /**
     * Default constructor
     */
    System.out.println("Starts Abstract Factory mode!");


    // 使用海尔工厂
    EFactory factory1;
    factory1 = new HaierFactory();
    TV tv1 = factory1.proudceTV();
    AirConditioner ac = factory1.produceAirConditioner();
    tv1.display();
    ac1.changeTemperature();
          /*   输出：
     Haier TV is displaying!
     Haier AirConditioner is changing temperature!
     */

    // 使用TCL工厂
    EFactory factory2;
    factory2 = new TCLFactory();
    TV tv2 = factory2.proudceTV();
    AirConditioner ac2 = factory2.produceAirConditioner();
    tv2.display();
    ac2.changeTemperature();
          /*   输出：
     TCL TV is displaying!
     TCL AirConditioner is changing temperature!
     */

}